//
//  HappiGoServer.h
//  HappiGO
//
//  Created by Zhuo LaiQiang on 11-9-26.
//  Copyright (c) 2011年 __MyCompanyName__. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ASIFormDataRequest.h"

@interface TaoBaoServer : NSObject<ASIHTTPRequestDelegate>
{
    ASIFormDataRequest *_request;
   
    NSString           *_urlStr;
    NSObject           *_object;    //如果要支持“网络等待视图”， 此对象须传入"UIView" or "UIViewController"
    SEL                 _select;
    SEL                 _isFaileSelect;
    
    NSDictionary       *_dic;
    BOOL               _showWaitView;
    
    NSDictionary       *_parameterDic; 
}

@property (nonatomic, retain) NSDictionary       *dic;
@property (nonatomic, retain) NSString           *urlStr;
@property SEL                 select;
@property SEL                 isFaileSelect;
@property (nonatomic, retain) NSDictionary       *parameterDic; 

//get方法
- (id)initWithUrl:(NSString *)urlStr_ 
           object:(id)object_ 
           select:(SEL)sel 
     showWaitView:(BOOL)ctr_;

//支持get和post方法并用
- (id)initWithUrl:(NSString *)urlStr_ 
           object:(id)object_ 
           select:(SEL)sel 
        parameter:(NSDictionary *)parameterDic_ 
     showWaitView:(BOOL)ctr_;

- (id)initWithUrl:(NSString *)urlStr_ 
           object:(id)object_ 
requestIsEndSelect:(SEL)endSelect 
requestIsFailSelect:(SEL)failSelect 
     showWaitView:(BOOL)ctr_
        urlEncode:(BOOL)encode_;

- (void)startAsynchronousRequest;

NSString *getURLCreateString(NSString *url);

@end